package com.woniuxy.springparking.service.Impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.woniuxy.springparking.common.RestResult;
import com.woniuxy.springparking.dao.TPerUserDao;
import com.woniuxy.springparking.pojo.TPerUser;
import com.woniuxy.springparking.service.TPerUserService;
import com.woniuxy.springparking.vo.TPerUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TPerUserServiceImpl implements TPerUserService {
    @Autowired
    private TPerUserDao tPerUserDao;
    @Override
    public RestResult findTUByPage(TPerUserVo tuVo) {
        Page<Object> pages= PageHelper.startPage(tuVo.getPage(),tuVo.getLimit());
        List<TPerUser> data=this.tPerUserDao.selectTUByPage(tuVo);
        return new RestResult(pages.getTotal(),data);
    }
}
